<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/jquery-1.12.4.min (1).js"></script>
</head>

<body>
    <form action="/login" id='fl' method="post">
        <input type="text" name="user_name" />
        <input type="password" name="password" />
        <button type="submit">提交</button>
    </form>

    <script>
        //方法一
        // $('#fl').submit(function(){
        //     alert('aa');
        // })

        //方法二
        $('#fl').on('submit', function(){
            alert('aacc');
        })
    </script>
</body>

</html>